package util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class CommonUtil {
	public String getCurrentDate(String format) {
		return new SimpleDateFormat(format == null ? "yyyy-MM-dd HH:mm:ss"
				: format).format(new Date());
	}
	public String getUniqueString(){
		return getCurrentSeconds()+getRandomNumber();
	}
	
	public String getCurrentSeconds(){
		return String.valueOf(new Date().getTime());
	}
	
	public String getRandomNumber(){
		return String.valueOf(new Random().nextInt(10000));
	}
	public static void main(String[] args) {
		StringBuffer buffer = new StringBuffer();
		System.out.println(buffer.length());
	}
}
